package com.kun.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import java.util.Date;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author SunKun
 * @since 2021-06-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Blog对象", description="")
public class Blog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "博客编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "博客标题")
    private String title;

    @ApiModelProperty(value = "博客摘要信息")
    private String summary;

    @ApiModelProperty(value = "博客发布时间")
    @TableField(fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date releaseDate;

    @ApiModelProperty(value = "点击阅读量")
    @TableField(fill = FieldFill.INSERT)
    private Integer clickHit;

    @ApiModelProperty(value = "评论数量")
    @TableField(fill = FieldFill.INSERT)
    private Integer replyHit;

    @ApiModelProperty(value = "博客内容")
    private String content;

    @ApiModelProperty(value = "博客所属分类")
    @TableField("typeId")
    private Integer typeId;

    @ApiModelProperty(value = "关键词")
    @TableField("keyword")
    private String keyword;

    @TableField(exist = false)//变量在表中不存在
    private String releaseDateStr;//格式化日期 年月

    @TableField(exist = false)
    private Integer blogCount;//日期的发布内容的数量

    //博客类别，一对一
    @TableField(exist = false)
    private BlogType blogtype;

    //博客内容，无html标签。获取博客内容的纯文本
    @TableField(exist = false)
    private String contentNoTag;

    //博客类型
    @TableField(exist = false)
    private String typeName;
}
